package com.gimi.cloud.bbp.entity.mall;

import java.math.BigDecimal;

import javax.persistence.Column;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.Table;
import javax.persistence.Transient;

import com.gimi.cloud.bbp.entity.base.BaseAppTable;
import com.gimi.cloud.bbp.entity.product.ProductSkuEntity;

/**
 * 购物车
 * @author lilinfeng
 */
@Table(name = "mall_cart")
public class MallCartEntity extends BaseAppTable{
	
	private static final long serialVersionUID = 1L;

	/**
     * 主键
     */
    @Id
    @Column(name = "cart_id")
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    private Integer cartId;

    /**
     * 用户id
     */
    @Column(name = "user_id")
    private Integer userId;

    /**
     * 商品Id
     */
    @Column(name = "prod_id")
    private String prodId;

    /**
     * 单品id
     */
    @Column(name = "sku_id")
    private String skuId;

    /**
     * 商品数量
     */
    @Column(name = "cart_num")
    private Integer cartNum;

    /**
     * 加入购物车时的单品价格
     */
    @Column(name = "cart_sku_price")
    private BigDecimal cartSkuPrice;

    /**
     * 状态(1：正常，2：无效)
     */
    @Column(name = "cart_status")
    private Integer cartStatus;
    
    /**
     * 单品
     */
    @Transient
    private ProductSkuEntity prodSku;

    /**
     * 获取主键
     *
     * @return cart_id - 主键
     */
    public Integer getCartId() {
        return cartId;
    }

    /**
     * 设置主键
     *
     * @param cartId 主键
     */
    public void setCartId(Integer cartId) {
        this.cartId = cartId;
    }

    /**
     * 获取用户id
     *
     * @return user_id - 用户id
     */
    public Integer getUserId() {
        return userId;
    }

    /**
     * 设置用户id
     *
     * @param userId 用户id
     */
    public void setUserId(Integer userId) {
        this.userId = userId;
    }

    /**
     * 获取商品Id
     *
     * @return prod_id - 商品Id
     */
    public String getProdId() {
        return prodId;
    }

    /**
     * 设置商品Id
     *
     * @param prodId 商品Id
     */
    public void setProdId(String prodId) {
        this.prodId = prodId;
    }

    /**
     * 获取单品id
     *
     * @return sku_id - 单品id
     */
    public String getSkuId() {
        return skuId;
    }

    /**
     * 设置单品id
     *
     * @param skuId 单品id
     */
    public void setSkuId(String skuId) {
        this.skuId = skuId;
    }

    /**
     * 获取商品数量
     *
     * @return cart_num - 商品数量
     */
    public Integer getCartNum() {
        return cartNum;
    }

    /**
     * 设置商品数量
     *
     * @param cartNum 商品数量
     */
    public void setCartNum(Integer cartNum) {
        this.cartNum = cartNum;
    }

    /**
     * 获取加入购物车时的单品价格
     *
     * @return cart_sku_price - 加入购物车时的单品价格
     */
    public BigDecimal getCartSkuPrice() {
        return cartSkuPrice;
    }

    /**
     * 设置加入购物车时的单品价格
     *
     * @param cartSkuPrice 加入购物车时的单品价格
     */
    public void setCartSkuPrice(BigDecimal cartSkuPrice) {
        this.cartSkuPrice = cartSkuPrice;
    }

    /**
     * 获取状态(1：正常，2：无效)
     *
     * @return cart_status - 状态(1：正常，2：无效)
     */
    public Integer getCartStatus() {
        return cartStatus;
    }

    /**
     * 设置状态(1：正常，2：无效)
     *
     * @param cartStatus 状态(1：正常，2：无效)
     */
    public void setCartStatus(Integer cartStatus) {
        this.cartStatus = cartStatus;
    }

	/**
	 * @return 单品
	 */
	public ProductSkuEntity getProdSku() {
		return prodSku;
	}

	/**
	 * @param prodSku 单品
	 */
	public void setProdSku(ProductSkuEntity prodSku) {
		this.prodSku = prodSku;
	}
}